#include "login.h"
#include "ui_login.h"
#include "mainwindow.h"
#include <QBitmap>
#include <QPainter>
#include "talkui.h"
#include <QMessageBox>
Login::Login(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Login)
{
    ui->setupUi(this);


    QString filename=":/img/img001.png";
     QImage *img=new QImage;
     img->load(filename);
        QImage *scaledimg=new QImage;
         *scaledimg=img->scaled(img->height(),90,Qt::KeepAspectRatio);
        ui->myAvatar->setPixmap(QPixmap::fromImage(*scaledimg));
        TalkUI::setPushButtonQss(ui->loginBtn);
        TalkUI::setPushTextButtonQss(ui->aboutBtn);

}

Login::~Login()
{

    delete ui;
}


void Login::on_loginBtn_clicked()
{
            close();
            MainWindow *w=new MainWindow;
//            w->setWindowFlag(Qt::WindowStaysOnTopHint);
            w->show();

}
